package com.KKd.Mapper;

import com.KKd.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.dao.support.DaoSupport;

import java.util.List;

/**
 * @author 14587
 * @date 2020/11/3 20:58
 */
//直接继承SqlSessionDaoSupport来实现userMapper
public class UserMapperImpl2 extends SqlSessionDaoSupport implements UserMapper {

    public List<User> getUser() {
        //继承了这个类可以直接获得sqlSession
        SqlSession sqlSession = getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.getUser();
    }
}
